//
// Created by francklinson on 2021/7/25 AT 22:04.
//
#include <iostream>

using namespace std;

class Solution {
public:
    int trailingZeroes(int n) {
        //
        //计算n/5,n/25,n/125....的结果之和即可,由于怕分母溢出，每次计算之后，先将n/5，然后再重复计算即可（因为是5的倍数）
        int ans = 0;
        while (n > 0) {
            ans += n / 5;
            n = n / 5;
        }
        return ans;
    }
};

int main() {
    Solution solution;
    cout << solution.trailingZeroes(5) << endl;
    cout << solution.trailingZeroes(3) << endl;
    return 0;
}

